using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace hkgoldenhighlight
{
	/// <summary>
	/// Description of BackgroundMusic.
	/// </summary>
	public partial class BackgroundMusic : Form
	{
		public BackgroundMusic()
		{
			InitializeComponent();
		}
		
		private void BrowseButtonClick(object sender, EventArgs e)
		{
			if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                BackgroundMusicPathSetTextBox.Text = openFileDialog1.FileName;
            }
		}
		
		private void OKButtonClick(object sender, EventArgs e)
		{
			InfFile.BackgroundMusic = BackgroundMusicPathSetTextBox.Text;
			InfFile.SaveToInfFile();
			this.Close();
		}
		
		private void BackgroundMusicLoad(object sender, EventArgs e)
		{
			BackgroundMusicPathSetTextBox.Text = InfFile.BackgroundMusic;
			if (InfFile.BackgroundMusic.Length > 0) {
				openFileDialog1.InitialDirectory = Path.GetDirectoryName(@InfFile.BackgroundMusic);
			}
			else {
				openFileDialog1.InitialDirectory = Application.StartupPath;
			}
			LoadFirstCheckBox.Checked = InfFile.LoadBGMFirst;
		}
		
		private void CancelButton1Click(object sender, EventArgs e)
		{
			this.Close();
		}
		
		private void LoadFirstCheckBoxCheckedChanged(object sender, EventArgs e)
		{
			InfFile.LoadBGMFirst = LoadFirstCheckBox.Checked;
		}
	}
}
